package cn.fintecher.pangolin.entity.mysql;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;

/**
 * @Auther: xiaqun
 * @Description: 实体主键
 * @Date: 9:39 2019/8/13
 */

@Data
@MappedSuperclass
class BaseEntity implements Serializable {
    @Id
    @GenericGenerator(
            name = "uuid2",
            strategy = "uuid2",
            parameters = {@org.hibernate.annotations.Parameter(
                    name = "uuid_gen_strategy_class",
                    value = "org.hibernate.id.uuid.CustomVersionOneStrategy")
            })
    @GeneratedValue(generator = "uuid2")

    @ApiModelProperty(value = "主键ID")
    private String id;
}
